package com.wframe.project.former.dataservices.faretemp;

import java.util.List;
import com.frame.database.JBaseService;
import com.frame.database.JServiceFactory;
import com.frame.database.JdataBean;

public class FaretempService extends JBaseService<FaretempDao>{

	public static FaretempService getIntance(){
        return JServiceFactory.createJServiceProxy(FaretempService.class);
    }
	
	public List<JdataBean> queryTemp() throws Exception{
		List<JdataBean> list=getDao().queryTemp();
		for(JdataBean bean:list){
			bean.put("arealist", getDao().queryAreas(bean.getString("id")));
		}
		return list;
	}
	
	public List<JdataBean> queryAreas(String tempid) throws Exception{
		return getDao().queryAreas(tempid);
	}

	public void saveDefault(JdataBean bean) throws Exception{
		getDao().saveDefault(bean);
	}
	public JdataBean getDefault() throws Exception{
		return getDao().getDefault();
	}
	public String saveTemp(JdataBean bean) throws Exception{
		return getDao().saveTemp(bean);
	}
	public void saveArea(String tempid,List<JdataBean> areas) throws Exception{
		getDao().saveArea(tempid,areas);
	}
	public void delTemp(String tempid) throws Exception{
		getDao().del(tempid);
		getDao().delAreas(tempid);
	}
}
